<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Block</title>
</head>

<body>
<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$sqlReport = "SELECT distinct `district_id`,`district_name`,`block_id`,`block_name` FROM `tbl_lookup_location` where `district_id` = ".$distId." group by `block_id`";
$queryReport = mysql_query($sqlReport);

?>
<table border="0" width="800" cellspacing="0" cellpadding="0">
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center">
		<font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">
		Yield Status of Handpumps</font></td>
	</tr>
	
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="49" bgcolor="#C5D8EB">
			<tr>
				<!--<td width="72" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  District</font></td>-->
				<td width="98" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Block</b></font></td>
				<td width="101" rowspan="2" align="center">
				<font face="Verdana" style="font-size: 8.5pt">
				<b>Functional (No.)</b></font></td>
				<td width="75" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Good (No.)</b></font></td>
				<td width="78" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Poor (No.)</b></font></td>
			  <td width="89" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Satisfactory (No.)</b></font></td>
				<td width="89" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Percent of Good Yield (%)</b></font></td>
				<td width="82" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Percent of Poor Yield (%)</b></font></td>
				<td width="96" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Percentage of Satisfactory Yield (%)</b></font></td>
			</tr>
		</table>		</td>
	</tr>
	<tr>
		<td>
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="49" bordercolor="#C5D8EB" style="border: 1px solid #BBD1E8" bgcolor="#F9F9F9">
			<?php
			//$numVillage=0;
			//$numFormVill=0;
			while($rowReport = mysql_fetch_array($queryReport)) {
			?><tr>
				<!--<td width='72' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php //echo $rowReport['district_name']; ?></font></td>-->
				<td width='97' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $rowReport['block_name']; ?></font></td>
				<td width='101' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getFunctionalStatusNoBlockWise($distId,'FUNCTIONAL',$rowReport['block_id']); ?></font></td>
				<td width='78' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getYieldStatusNoBlockWise($distId,'Good',$rowReport['block_id']); ?></font></td>
				<td width='78' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getYieldStatusNoBlockWise($distId,'Poor',$rowReport['block_id']); ?></font></td>
				<td width='87' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getYieldStatusNoBlockWise($distId,'Satisfactory',$rowReport['block_id']); ?></font></td>
				
				<td width='89' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo percentYieldBlockWise($distId,'FUNCTIONAL','Good',$rowReport['block_id']); ?></font></td>
				<td align='center' width='83'><font face="Verdana" style="font-size: 8.5pt"><?php echo percentYieldBlockWise($distId,'FUNCTIONAL','Poor',$rowReport['block_id']); ?></font></td>
				<td align='center' width='95'><font face="Verdana" style="font-size: 8.5pt"><?php echo percentYieldBlockWise($distId,'FUNCTIONAL','Satisfactory',$rowReport['block_id']); ?></font></td>
				
			</tr>
			<?php
			//$numVillage+=$rowReport['NumVill'];
			//$numFormVill+=$numFormVillage;
			}
			?>
			<tr bgcolor="#E9E9E9"><td width='72' colspan="1" align='center'><font face="Verdana" style="font-size: 8.5pt"><b>Total</b></font></td>
			
				<td width='101' align='center'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo getFunctionalStatusNoDistWise($distId,'FUNCTIONAL'); ?></b></font></td>
				<td width='78' align='center'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo getYieldStatusNoDistWise($distId,'Good'); ?></b></font></td>
				<td width='78' align='center'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo getYieldStatusNoDistWise($distId,'Poor'); ?></b></font></td>
				<td width='87' align='center'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo getYieldStatusNoDistWise($distId,'Satisfactory'); ?></b></font></td>
				<td width='89' align='center'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo percentYieldDistWise($distId,'FUNCTIONAL','Good'); ?></b></font></td>
				<td align='center' width='83'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo percentYieldDistWise($distId,'FUNCTIONAL','Poor'); ?></b></font></td>
				<td align='center' width='95'><font face="Verdana" style="font-size: 8.5pt"><b><?php echo percentYieldDistWise($distId,'FUNCTIONAL','Satisfactory'); ?></b></font></td>
			</tr>
		</table>		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>


</body>

</html>